﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kangaroo
{
    public static class Extensions
    {
        public static Optional<TValue> TryGetValue<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
        {
            TValue value;
            return dictionary.TryGetValue(key, out value) ? Optional.Some(value) : Optional.None;
        }
    }
}
